<?php
/*
 * ebiz front
 *
 * ShoppingcartView
 *
 * @author li.jp
 *
 */
?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
	<head>
		<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
		<title></title>
        <script type='text/javascript' language='javascript' src='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/n/javascript/lib/jquery.js'></script>
		<script type='text/javascript' language='javascript' src='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/n/javascript/frontend.js'></script>
		<link href='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/t/<?php echo $config ['template_name']; ?>/css/style.css' rel='stylesheet' type='text/css' />
        <!--  <script type='text/javascript'>
         //<![CDATA[
            $(document).ready(function(){
                HeaderMenuController.showMenu();
            });
        //]]>
        </script>-->
        <?php echo $headInfo; ?>
    </head>

<body onload="javascript:MyAccount.printorder()">
<div class="content">
        <?php echo $headerView; ?>
        <div class="clear"></div>
        <!-- center content -->
    <div class='center'>
	<div class="mysummaryCenterRight" style="float:left">
        <div>
			<table width="530" border="0">
			  <tr>
				<td width="530">
					<table width="530" border="0">
					  <tr>
						<td width="530" class="mysummaryTitleStyle" ><h4><?php echo MYORDERVIEW; ?></h4></td>
					  </tr>
					  <tr>
						<td><label class="mysummaryTitleStyle"><?php echo ABOUTTHISORDER ;?></label><?php echo MH; ?><span class="mysummaryContentStyle"><?php echo ORDERNUM; ?><?php echo $orders[0][0]['order_num'] ;?><?php echo PZ; ?><?php echo empty($orders[0][0]['status']) ? "" : Order::getOrderStatus($orders[0][0]['status']); ?></span></td>
					  </tr>
					  <tr>
						<td><span class="mysummaryTitleStyle"><?php echo ORDERDATE ;?></span><?php echo MH; ?><span class="mysummaryContentStyle"><?php echo $orders[0][0]['created'] ;?></span></td>
					  </tr>
					</table>
					<br />
					<table width="530" border="0" cellspacing="0" cellpadding="0"  class="mysummaryContentFootborder">
					  <tr>
						<td width="2">&nbsp;</td>
						<td width="260">&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td  class="mysummaryContentTitleStyle"><?php echo SHIPPINGADDRESS; ?> </td>
						<td  class="mysummaryContentTitleStyle" ><?php echo SHIPPINGMETHOD; ?></td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td></td>
						<td>&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo $orders[1][0]['first_name']; ?>&nbsp;<?php echo $orders[1][0]['last_name']; ?></td>
						<td class="mysummaryContentStyle"><?php echo empty($orders[0][0]['shipping_expect'])? "" :Order::getShippingExpect($orders[0][0]['shipping_expect']) ;?></td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo $orders[1][0]['address1']; ?>&nbsp;<?php echo empty($orders[1][0]['address2']) ? "" :$orders[1][0]['address2'] ;?></td>
						<td>&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo $orders[1][0]['city']; ?><?php echo DH; ?><?php echo $orders[1][0]['zip_code']; ?><?php echo DH; ?><?php echo empty($orders[1][0]['state'])?"":Order::getStateName($orders[1][0]['state']) ;?></td>
						<td>&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo $orders[1][0]['country']; ?></td>
						<td>&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo TELL; ?><?php echo $orders[1][0]['phone'] ; ?></td>
						<td>&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
					  	<td></td>
					  	<td>&nbsp;</td>
					  </tr>
					</table>
					<br />
					<table width="530" border="0" cellspacing="0" cellpadding="0" class="mysummaryContentFootborder">
					  <tr>
						<td width="2">&nbsp;</td>
						<td width="260">&nbsp;</td>
					  </tr>
					  <tr>
					 	 <td width="20"></td>
						<td  class="mysummaryContentTitleStyle" ><?php echo BILINGADDRESS ;?></td>
						<td  class="mysummaryContentTitleStyle" ><?php echo PAYMENTMETHOD ;?></td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td></td>
						<td>&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo $orders[2][0]['first_name']; ?>&nbsp;<?php echo $orders[2][0]['last_name']; ?></td>
						<td class="mysummaryContentStyle" ><?php echo  CREDITCARDTYPE; ?><?php echo MH; ?> <?php echo empty($orders[0][0]['payment_method'])? "" :Order::getPaymentMethod($orders[0][0]['payment_method']) ;?></td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo $orders[2][0]['address1']; ?>&nbsp;<?php echo empty($orders[2][0]['address2']) ? "" :$orders[2][0]['address2'] ;?></td>
						<td class="mysummaryContentStyle" ></td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
                        <td class="mysummaryContentStyle"><?php echo $orders[2][0]['city']; ?><?php echo DH; ?><?php echo $orders[2][0]['zip_code']; ?><?php echo DH; ?><?php echo empty($orders[2][0]['state'])?"":Order::getStateName($orders[2][0]['state']) ;?></td>
						<td class="mysummaryContentStyle" ></td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo $orders[2][0]['country']; ?></td>
						<td class="mysummaryContentStyle" > </td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td class="mysummaryContentStyle"><?php echo TELL; ?><?php echo $orders[2][0]['phone'] ; ?></td>
						<td>&nbsp;</td>
					  </tr>
					  <tr>
					  	<td width="20"></td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					  </tr>
					</table>
                </td>
              </tr>
			</table>
		</div>
		<div>
				<table width="530" border="0" >
				  <tr>
					<td height="13" class="mysummaryTitleStyle"><h4><?php echo ITEMSORDERED; ?></h4></td>
				  </tr>

				  <tr>
				    <td valign="bottom">
				    	<div class="mysummaryOrderTable">
                        <?php
                                if(!empty($orderitemsNotInAnyPackage)){
                        ?>
                        <!--                        <table width="530" border="0" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC" class="myaccountsummary_order_border_style"> -->
					    <table width="530" border="0" cellspacing="0" cellpadding="0"  >
                          <tr>
					        <td colspan="5" valign="bottom" ><span class="mysummaryContentTitleStyle"><br/><?php echo NOTINPACKAGE; ?></span><br/>
                                <br/>
                                  <table width="520" border="0" cellspacing="0" cellpadding="5"  >
                                  <!--                                   <table width="520" border="0" cellspacing="0" cellpadding="5" bordercolor="#CCCCCC" class="myaccountsummary_order_border_style"> -->
                                      <tr>
                                        <td width="305"  bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo ITEM;?></td>
                                        <td align="center" width="70"  bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo PRICE;?></td>
                                        <td align="center" width="60"  bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo QTY;?></td>
                                        <td align="center" width="60"  bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo TOTAL;?></td>
                                      </tr>
                                      <?php
                                        foreach($orderitemsNotInAnyPackage as $item){
                                      ?>
                                      <tr>
                                        <td><?php echo $item['title']; ?></td>
                                        <td align="center"><?php echo UNIT;?><?php echo $item['sale_price']; ?></td>
                                        <td align="center"><?php echo $item['quantity']; ?></td>
                                        <td align="center"><?php echo UNIT;?><?php echo number_format($item['deal_price']*$item['quantity'],2); ?></td>
                                      </tr>
                                      <?php }?>
                                  </table>
                                  <br/>
                              </td>
                          </tr>
					    </table>
                        <?php echo "<br/>"; }else{}?>
					    </div>
				    </td>
				  </tr>
                   <tr>
				    <td>
				    	<div class="mysummaryOrderTable">
                        <?php
							if(empty($orderpackages)){
					     ?>
					     <?php }else {
				   		 	for ($i=0;$i<count($orderpackages);$i++){
				   		?>
					    <table width="530" border="0" cellspacing="0" cellpadding="0"  >
                        <!--                        <table width="530" border="0" cellspacing="0" cellpadding="0" bordercolor="#CCCCCC" class="myaccountsummary_order_border_style"> -->
					      <tr>
					        <td colspan="5" valign="bottom" >
                            <lable class="mysummaryTitleStyle"><br/><?php echo PACKAGENUM; ?></lable><?php echo MH; ?><?php echo JH; ?><?php echo  $orderpackages[$i]['package_num']; ?>&nbsp;<br/>
                            <lable class="mysummaryTitleStyle"><?php echo TRACKNUM; ?></lable><?php echo MH; ?><?php echo JH; ?><?php echo  $orderpackages[$i]['tracking_num']; ?><br/>
                                  <br/>
                                  <table width="520" border="0" cellspacing="0" cellpadding="5"  >
                                  <!--                                   <table width="520" border="0" cellspacing="0" cellpadding="5" bordercolor="#CCCCCC" class="myaccountsummary_order_border_style"> -->
                                      <tr>
                                        <td width="305"  bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo ITEM;?></td>
                                        <td align="center" width="70"   bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo PRICE;?></td>
                                        <td align="center" width="60"   bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo QTY;?></td>
                                        <td align="center" width="60"  bgcolor="#E6E6E6" class="mywishlistSubtitle"><?php echo TOTAL;?></td>
                                      </tr>
                                      <?php
                                        foreach ($productitems[$i] as $value){
                                            foreach ($value as $item){
                                      ?>
                                      <tr>
                                        <td><?php echo $item['title']; ?></td>
                                        <td align="center"><?php echo UNIT;?><?php echo $item['sale_price']; ?></td>
                                        <td align="center"><?php echo $item['quantity']; ?></td>
                                        <td align="center"><?php echo UNIT;?><?php echo number_format($item['deal_price']*$item['quantity'],2); ?></td>
                                      </tr>
                                      <?php
                                            }
                                        }
                                      ?>
                                  </table>
                                  <br/>
                              </td>
                          </tr>
					    </table>
					    <br/>
                        <?php
							}
						}?>
					    </div>
				    </td>
				  </tr>
				</table>
                <div class="myorderTotalStyle">
                    <div class="scPriceInfo">
                        <span class="scPriceLabel" style="width: 160px;"><?php echo COMERCHANDISETOTALLABEL;?></span>
                        <span class="scPriceLabel" style="width: 80px"><?php echo $orders[0][0]['merchandise_total'] ;?></span>
                    </div>
                    <div class="scPriceInfo">
                        <span class="scPriceLabel" style="width: 160px;"><?php echo COSHIPPINGCHARGESLABEL;?></span>
                        <span class="scPriceLabel" style="width: 80px;"><?php echo $orders[0][0]['shipping_fee'] ;?></span>
                    </div>
                    <div class="scPriceInfo">
                        <span class="scPriceLabel" style="width: 160px;"><?php echo COESTIMATEDLABEL;?></span>
                        <span class="scPriceLabel" style="width: 80px;"><?php echo $orders[0][0]['tax_rate_fee'] ;?></span>
                    </div>
                    <div class="scPriceInfo">
                        <span class="scPriceLabel" style="width: 160px;"><?php echo CODISCOUNTLABEL;?></span>
                        <span class="scPriceLabel" style="width: 80px;"><?php echo $orders[0][0]['discount_fee'] ;?></span>
                    </div>
                    <div class="clear"></div>
                    <div class="scPriceTotalLabel">
                        <span class="scPriceLabel" style="width: 160px;"><?php echo COTOTALLABEL;?></span>
                        <span class="scPriceLabel" style="width: 80px;"><?php echo $orders[0][0]['total'] ;?></span>
                    </div>
                </div>
          </div>
	</div>
    <div class='clear'></div>
</div>
        <!-- center content -->
            <div class="clear"></div>
            <?php echo $footerView; ?>
</div>
</body>
</html>